global with sharing class SoapWebserviceExample {
   @ReadOnly
     webservice static List<id> retId(){
        //List<Account> accList = new List<Account>(); 
        
        List<id> idList = new List<id>();
         try{
         For(Account accList:[Select id, name from Account limit 10]){
         
         idList.add(accList.id);
         }
        }
        
        catch(Exception ex){
            
        }
        return idList;
        
     }
}